Page({
  data: {
    point: {
      left: 0,
      top: 0,
    },
    logs: [Date.now()]
  },

  formate(timeStamp) {
    console.log('formate')
    return '格式化之后的内容'
  },

  // 按下
  touchstart(event) {
    // 记录手指的坐标
    this.x = event.touches[0].clientX
    this.y = event.touches[0].clientY
  },

  touchmove(event) {
    console.log('event', event)
    // 获取最新 x y
    const x = event.touches[0].clientX
    const y = event.touches[0].clientY
    // 计算偏移量
    const disX = x - this.x
    const disY = y - this.y
    console.log('disX', disX)
    console.log('disY', disY)
    // 修改元素的 left 与 top
    this.setData({
      "point.left": 0 + disX,
      "point.top": 0 + disY
    })
  }
})